package com.br.fiscalizacao.domain;

import com.br.fiscalizacao.reference.DocumentoTipo;
import com.br.fiscalizacao.reference.SituacaoDoc;
import java.util.Date;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord(table = "documento", finders = { "findDocumentoesByData_documentoEqualsOrSituacao_documentoOrAssuntoLikeOrInteressadoLikeOrResponsavelLikeOrNum_documentoEquals" })
public class Documento {

    @Size(max = 8)
    private String num_documento;

    @Enumerated
    private DocumentoTipo tipo_documento;

    @Past
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date data_documento;

    @Size(max = 60)
    private String assunto;

    @Size(max = 60)
    private String responsavel;

    @Size(max = 60)
    private String interessado;

    @Enumerated
    private SituacaoDoc situacao_documento;

    private String filename;

    private Byte content;

    private String contentType;

    @Size(max = 100)
    private transient String url;

    @ManyToOne
    private Requisicao requisicoess;

    @ManyToOne
    private CheckListCgu checkListCgu_;

    @ManyToOne
    private CheckListMinicom checkListMinicom_;

    @ManyToOne
    private CheckListGesac checkListGesac_;
}
